package com.sk.sourcecircle.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.sourcecircle.R;
import com.sk.sourcecircle.entity.NoticeDetailsInfo;
import com.sk.sourcecircle.utils.MyUtils;

import java.util.List;

/**
 * Created by sk on 2018/1/2.
 */

public class ConsultCommentAdapter extends BaseQuickAdapter<NoticeDetailsInfo.DataBean.CommentListBean,BaseViewHolder>{

    public ConsultCommentAdapter(int layoutResId, @Nullable List<NoticeDetailsInfo.DataBean.CommentListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NoticeDetailsInfo.DataBean.CommentListBean item) {
        Glide.with(mContext).load(item.getUser().getHead_url()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into((ImageView) helper.getView(R.id.head_img));
        helper.setText(R.id.tv_name,item.getUser().getNickname())
                .setText(R.id.tv_content,item.getContent())
                .setText(R.id.tv_time, MyUtils.getTimeFormatText(item.getCreate_time()));
    }
}
